home *** CD-ROM | disk | FTP | other *** search
/ GameStar Special 2004 September / GSSH0904CD1.iso / RiseofNations / RedFront / RedFront.exe / Red Front / Red Front - 02 - Odessa.bhs < prev    next >
Text File  |  2003-12-28  |  8KB  |  319 lines

  1. /* Red Front
  2.    Odessa
  3.    
  4.    These events will control the Odessa scenario for the Red Front campaign.
  5.   
  6.    Campaign By: Kevin 'DarthVeda' Chulski
  7.    Contact: darthveda@hotmail.com
  8.    Please email any questions/suggestions/comments that you have!   
  9. */
  10.  
  11. scenario
  12. {
  13.  
  14.   set_nation_name("Russians", $S("Red Army"));
  15.   set_nation_name("Romans", $S("Romanians"));
  16.   
  17.   // initialize variables
  18.   
  19.   static int SPAWN_LOCATION = 0; 
  20.   static int marine_msg = 0;
  21.   static int initial_vic = 30; // amount of time allocated to win scenario (in minutes)
  22.   
  23.   static int X = 0;
  24.   static int Y = 0;
  25.   static int X2 = 0;
  26.   static int Y2 = 0;
  27.   static int m = 0;
  28.   static int m2 = 0;
  29.   
  30.   static int ponc = 0;
  31.   static int dalc = 0;
  32.   
  33.   // grab city IDs from the start so player can't change in midstream
  34.   // and mess up later events
  35.   static int dal_id = find_city_id( "Dalnic" );
  36.   static int pon_id = find_city_id( "Pontanka" );
  37.  
  38. labels {
  39.   //Add any constant labels here in a comma separated list.
  40.   
  41. }
  42.  
  43. run_once {
  44.   //Insert commands that should be executed only once when the script is loaded here.
  45.   
  46.   //disable weird things
  47.   
  48.   disable_type("Helicopter");
  49.   disable_type("Nuclear Missile");
  50.   disable_type("Spy");
  51.   disable_tech(3, "Allegiance");
  52.   disable_tech(3, "Computerization");
  53.   set_music_mood("losing", true);
  54.   
  55.   // disable wonders
  56.   
  57.   disable_type( "Pyramids" );
  58.   disable_type( "Colossus" );
  59.   disable_type( "Terra Cotta Army" );
  60.   disable_type( "Colosseum" );
  61.   disable_type( "Temple of Tikal" );
  62.   disable_type( "Porcelain Tower" );
  63.   disable_type( "Angkor Wat" );
  64.   disable_type( "Versailles" );
  65.   disable_type( "Statue of Liberty" );
  66.   disable_type( "Kremlin" );
  67.   disable_type( "Taj Mahal" );
  68.   disable_type( "Eiffel Tower" );
  69.   disable_type( "Supercollider" );
  70.   disable_type( "Space Program" );
  71.   
  72.   // disable certain buildings
  73.   
  74.   disable_type( "Scholar" );
  75.   disable_type( "Small City" );
  76.   disable_type( "University" );
  77.   disable_type( "Library" );
  78.   
  79.   // set timers
  80.   
  81.   set_timer("outlast", 600);
  82.   set_timer("bigpush", 1560);
  83.   set_timer("the_end", 1800);
  84.   set_timer("vicupdater", 60);
  85.   
  86.   set_timer("reinforcements", 50);
  87.   set_timer("marines",90);
  88.   
  89.   // disable triggers
  90.   
  91.   // blurb
  92.   
  93.   popup_dialog("August 1941 - The situation is grim, comrade general.  Most of the Soviet Union's borders have been overrun and now we receive word that the Romanians have crossed the border and have their eyes set on conquering the Ukraine.  The forces under your command are either poorly trained or whipped from fighting the Germans in the north.  However, you will have to make the best defense of Odessa until Moscow levies new orders for you.  Defend to the last, comrade general.");
  94.   popup_dialog("NEW OBJECTIVE: Survive for 30 minutes.");
  95.   add_objective( "Survive for 30 minutes", "survive", "null.wav");
  96.   
  97. }
  98.  
  99.   trigger vic_updater ( timer_expired( "vicupdater" ) )
  100.   {
  101.     initial_vic--;
  102.     set_timer( "vicupdater", 60 );
  103.     if ( initial_vic != 1 )
  104.     {
  105.       change_objective_text("survive", "Survive for " + initial_vic + " minutes");
  106.     }
  107.     else
  108.     {
  109.       change_objective_text("survive", "Survive for " + initial_vic + " minute");
  110.     }
  111.     enable_trigger( vic_updater );
  112.   }
  113.   
  114.   trigger dal_captured ( city_id_captured(1,dal_id) )
  115.   {
  116.     dalc = 1;
  117.   }
  118.   
  119.   trigger dal_liberated ( city_id_captured(2,dal_id) )
  120.   {
  121.     dalc = 0;
  122.   }
  123.   
  124.   trigger pon_captured ( city_id_captured(1,pon_id) )
  125.   {
  126.     ponc = 1;
  127.   }
  128.   
  129.   trigger pon_liberated ( city_id_captured(2,pon_id) )
  130.   {
  131.     ponc = 0;
  132.   }
  133.  
  134.   trigger reinforce ( timer_expired( "reinforcements" ) )
  135.   {
  136.   
  137.     if ( 15 < initial_vic <= 20 )
  138.     {
  139.     m = 1;
  140.     m2 = 0;
  141.     }
  142.     if ( 10 < initial_vic <= 15 )
  143.     {
  144.     m = 2;
  145.     m2 = 1;
  146.     }
  147.     else if ( 5 < initial_vic <= 10 )
  148.     {
  149.     m = 4;
  150.     m2 = 2;
  151.     }
  152.     else if ( 0 < initial_vic <= 5 )
  153.     {
  154.     m = 8;
  155.     m2 = 4;
  156.     }
  157.     
  158.     // Rotating spawn locations
  159.     if ( (SPAWN_LOCATION%3) == 0 )
  160.     {
  161.         X=78;
  162.         Y=216;
  163.         X2=196;
  164.         Y2=185;
  165.     }
  166.     else if ( (SPAWN_LOCATION%3) == 1 )
  167.     {
  168.         X=265;
  169.         Y=306;
  170.         if ( dalc )
  171.         {
  172.           X2=196;
  173.           Y2=185;
  174.         }
  175.         else
  176.         {
  177.           X2=198;
  178.           Y2=257;
  179.         }
  180.     }
  181.     else
  182.     {
  183.         X=126;
  184.         Y=36;
  185.         if ( ponc )
  186.         {
  187.           X2=196;
  188.           Y2=185;
  189.         }
  190.         else
  191.         {
  192.           X2=168;
  193.           Y2=105;
  194.         }
  195.     }
  196.     
  197.     SPAWN_LOCATION++;
  198.     
  199.     create_unit(2,X,Y,"Tank",1+m2);
  200.     group_attack_to_order(2,X2,Y2);
  201.     create_unit(2,X,Y,"Infantry",4+m);
  202.     group_attack_to_order(2,X2,Y2);
  203.     create_unit(2,X,Y,"Bazooka",1);
  204.     group_attack_to_order(2,X2,Y2);
  205.     create_unit(2,X,Y,"Heavy Machine Gun",1);
  206.     group_attack_to_order(2,X2,Y2);
  207.     create_unit(2,X,Y,"Armored Scout Car",1);
  208.     group_attack_to_order(2,X2,Y2);
  209.     create_unit(2,X,Y,"Supply Wagon",1);
  210.     group_attack_to_order(2,X2,Y2);
  211.     create_unit(2,X,Y,"Howitzer",1);
  212.     group_attack_to_order(2,X2,Y2);
  213.     create_unit(2,X,Y,"General",1);
  214.     group_attack_to_order(2,X2,Y2);
  215.     
  216.     // send in some supplies
  217.     give_good(2,"food",100);
  218.     give_good(2,"timber",100);
  219.     give_good(2,"metal",100);
  220.     give_good(2,"oil",100);
  221.     
  222.     set_timer("reinforcements",50);
  223.     
  224.     enable_trigger( reinforce );
  225.   
  226.   }
  227.   
  228.   trigger the_marines ( timer_expired( "marines" ) )
  229.   {
  230.     if ( marine_msg == 0 )
  231.     {
  232.       move_camera(304,14);
  233.       popup_dialog( "A convoy of reinforcements is headed our way from Sevestapol.  It contains a shipment of new Katyusha rockets.  Let us put them to good use against the enemies of the Motherland." );
  234.       marine_msg++;
  235.     }
  236.     ping(1,1,304,14);
  237.     create_unit(1,304,14,"Riflemen",5);
  238.     group_move_order(1,197,170);
  239.     create_unit(1,304,14,"Machine Gun",1);
  240.     group_move_order(1,197,170);
  241.     create_unit(1,304,14,"Katyusha Rocket",1);
  242.     group_move_order(1,197,170);
  243.     set_timer("marines",90);
  244.     enable_trigger( "the_marines" ); 
  245.   }
  246.   
  247.   trigger avenger ( unit_type_killed( 2,"Tank") )
  248.   {  
  249.     create_unit(2,X,Y,"Infantry",2);
  250.     group_attack_to_order(2,X2,Y2);
  251.     enable_trigger( "avenger" ); 
  252.   }
  253.   
  254.   trigger ftr_shot_down ( unit_type_killed( 2, "Fighter" ) )
  255.   {
  256.     create_unit(2,77,213,"Fighter",1);
  257.     enable_trigger( "ftr_shot_down" );
  258.   }
  259.   
  260.   trigger bmr_shot_down ( unit_type_killed( 2, "Bomber" ) )
  261.   {
  262.     create_unit(2,77,213,"Bomber",1);
  263.     enable_trigger( "ftr_shot_down" );
  264.   }
  265.   
  266.   trigger big_push ( timer_expired( "bigpush" ) )
  267.   { 
  268.     
  269.     for ( int i = 0; i < 3; i++ )
  270.     {
  271.       if ( (i%3) == 0 )
  272.       {
  273.           X=78;
  274.           Y=216;
  275.           X2=196;
  276.           Y2=185;
  277.       }
  278.       else if ( (i%3) == 1 )
  279.       {
  280.           X=265;
  281.           Y=306;
  282.           X2=198;
  283.           Y2=257;
  284.       }
  285.       else
  286.       {
  287.           X=126;
  288.           Y=36;
  289.           X2=168;
  290.           Y2=105;
  291.       }
  292.         
  293.       create_unit(2,X,Y,"Tank",12);
  294.       group_attack_to_order(2,X2,Y2);
  295.       create_unit(2,X,Y,"Infantry",15);
  296.       group_attack_to_order(2,X2,Y2);
  297.       create_unit(2,X,Y,"Bazooka",4);
  298.       group_attack_to_order(2,X2,Y2);
  299.       create_unit(2,X,Y,"Heavy Machine Gun",4);
  300.       group_attack_to_order(2,X2,Y2); 
  301.       create_unit(2,X,Y,"Supply Wagon",2);
  302.       group_attack_to_order(2,X2,Y2);
  303.       create_unit(2,X,Y,"Howitzer",5);
  304.       group_attack_to_order(2,X2,Y2);
  305.       create_unit(2,X,Y,"General",2);
  306.       group_attack_to_order(2,X2,Y2);
  307.     } // end of for loop
  308.   }
  309.   
  310.   trigger time_is_up_2 ( timer_expired( "the_end" ) )
  311.   {
  312.       
  313.       objective_complete( "survive" );
  314.       popup_dialog("Excellent work comrade general.  We have been able to hold up the German and Romanian offensive despite the odds against us.  Your troops have been relieved temporarily and will join up with other combat units elsewhere on the front.  Though we have lost this battle, we have not yet lost the war!");
  315.       popup_dialog("You are now ready for the third part of this campaign.  Please load the next scenario in the Red Front sequence.");
  316.       victory( 1 );
  317.   }
  318.  
  319. }